perm filename IMP.MID[NET,MRC] blob
sn#618002 filedate 1981-10-10 generic text, type C, neo UTF8
COMMENT ⊗ VALID 00009 PAGES
C REC PAGE DESCRIPTION
C00001 00001
C00002 00002 INTIMS RFCS RFCR CLSS CLSR LGONCE REAPRV WRTPRV UPGPRV ACWPRV LUPPRV PRIVS SWPBLK SVRNAM RUNPPN FFLNK LOGGER LNKTAB LNKDDB IMPLS IMPFS IMPSTB HSTSTR PDL IMPDIE FLNOPS RSTRST RSTHST WHYDWN REASON UNWUNW UNWIDX
C00004 00003 IMP PROMPT ERROR CRLRET GIVHLP
C00006 00004 NCPOP BACKWH GTHOUR HRWIN NOWHEN
C00010 00005 UNWEDG
C00011 00006 RSTOP ALPHST HSTCHR HSTTAB
C00013 00007 NETSTA MSGLUP NXTMSG NAME NMSGS MSG
C00017 00008 USLOGR RFCSER CHKLNK CONMSG NXTLNK
C00021 00009 DECOUT OCTOUT NUMOUT GETNUM GETNM1 GETOCT GETOC1
C00022 ENDMK
C⊗;
;INTIMS RFCS RFCR CLSS CLSR LGONCE REAPRV WRTPRV UPGPRV ACWPRV LUPPRV PRIVS SWPBLK SVRNAM RUNPPN FFLNK LOGGER LNKTAB LNKDDB IMPLS IMPFS IMPSTB HSTSTR PDL IMPDIE FLNOPS RSTRST RSTHST WHYDWN REASON UNWUNW UNWIDX
TITLE IMP
SUBTTL DATA
; Mark Crispin, SU-AI, 3/79
; General purpose IMP utility
INTIMS==000020,,
RFCS== 200000,,
RFCR== 100000,,
CLSS== 040000,,
CLSR== 020000,,
LGONCE==004000,,
REAPRV==040000,,
WRTPRV==020000,,
UPGPRV==004000,,
ACWPRV==000040,,
LUPPRV==000001,,
PRIVS==REAPRV\WRTPRV\UPGPRV\ACWPRV\LUPPRV
SWPBLK: 'DSK,,
SVRNAM: 'RFC,,
14
0
'NETSYS
RUNPPN: BLOCK 1
FFLNK: BLOCK 1
LOGGER: BLOCK 1
LNKTAB: (7)
LNKDDB: (7)
IMPLS: (7)
IMPFS: (7)
IMPSTB: (7)
HSTSTR: BLOCK 20.
PDL: BLOCK 50.
IMPDIE: 0
FLNOPS: 0
RSTRST: 22
RSTHST: 0
WHYDWN: 23
REASON: 0
UNWUNW: 24
UNWIDX: 0
;IMP PROMPT ERROR CRLRET GIVHLP
SUBTTL Main program
IMP: CAI
RESET
MOVE 17,[PDL(-50.)]
MOVSI 377777
SETPR2
JRST 4,.-1
MOVSI (UPGPRV)
SETPRV ; we need this priv for almost everything
OPEN [0 ? 'IMP,, ? 0]
JRST 4,.-1
MOVEI [.RSQZ 0,IMPDIE ? 0]
.SYML
JRST 4,.-1
ADDI 400000
MOVEM IMPDIE
MOVEI [.RSQZ 0,FLNOPS ? 0] ; first entry in our tables
.SYML
JRST 4,.-1
ADDI 400000
MOVEM FLNOPS
PROMPT: INSKIP
CAI
OUTCHR ["!]
INCHRW
CAIN ↑M
INCHRW
CAIN "?
JRST [ OUTSTR [ASCIZ/ H/]
JRST GIVHLP]
ANDI 137
CAIN ↑J
JRST PROMPT
CAIN "H
JRST GIVHLP
CAIN "E
JRST [ OUTSTR [ASCIZ/xit/]
EXIT 1,
JRST IMP]
CAIN "U
JRST UNWEDG
CAIN "L
JRST USLOGR
CAIN "N
JRST NCPOP
CAIN "R
JRST RSTOP
CAIN "C
JRST [ OUTSTR [ASCIZ/ycle the network/]
;; EIOTM
;; CONO 400,100000 ;this doesn't work on F2, where IMP=550
SKIPN @IMPDIE ;skip if NCP already down
MTAPE [13] ;take NCP down
MTAPE [12] ;put NCP up
JRST 2,@[CRLRET]]
CAIN "S
JRST NETSTA
ERROR: CLRBFI
OUTCHR ["?]
CRLRET: OUTSTR [ASCIZ/
/]
JRST PROMPT
GIVHLP: OUTSTR [ASCIZ\elp:
Cycle, Exit, Help, Logger, NCP on/off, Reset, Statistics, Unwedge
\]
JRST PROMPT
;NCPOP BACKWH GTHOUR HRWIN NOWHEN
SUBTTL NCP operations
NCPOP: OUTSTR [ASCIZ/CP o/]
INCHRW
ANDI 137
CAIN "N
JRST [ SKIPN @IMPDIE
JRST ERROR
MTAPE [12] ;put NCP up
JRST CRLRET]
CAIE "F
JRST ERROR
OUTCHR ["f]
SKIPE @IMPDIE
JRST ERROR
OUTSTR [ASCIZ/, back up on /]
BACKWH: INCHRW
CAIN "?
JRST [ OUTSTR [ASCIZ/
Day of week back up (or "D" for "Don't tell IMP when up or why down")
Back up on /]
CLRBFI
JRST BACKWH]
ANDI 137
CAIN "D
JRST [ OUTSTR [ASCIZ*on't tell IMP when or why. Confirm w/CR.*]
INCHRW
CAIE 15
JRST ERROR
INCHSL ;read the LF
JFCL ;isn't one?? oh well.
JRST NOWHEN ] ;Just take network down
CAIN "M
JRST [ OUTSTR [ASCIZ/onday/]
SETZ 2,
JRST GTHOUR]
CAIN "W
JRST [ OUTSTR [ASCIZ/ednesday/]
MOVEI 2,2
JRST GTHOUR]
CAIN "F
JRST [ OUTSTR [ASCIZ/riday/]
MOVEI 2,4
JRST GTHOUR]
CAIN "S
JRST [ INCHRW
ANDI 137
CAIN "A
JRST [ OUTSTR [ASCIZ/turday/]
MOVEI 2,5
JRST GTHOUR]
CAIE "U
JRST ERROR
OUTSTR [ASCIZ/nday/]
MOVEI 2,6
JRST GTHOUR]
CAIE "T
JRST ERROR
INCHRW
ANDI 137
CAIN "U
JRST [ OUTSTR [ASCIZ/esday/]
MOVEI 2,1
JRST GTHOUR]
CAIE "H
JRST ERROR
OUTSTR [ASCIZ/ursday/]
MOVEI 2,3
GTHOUR: OUTSTR [ASCIZ/ at /]
JSR GETNUM
CAIG 23.
CAIE 1,":
JRST ERROR
JUMPL ERROR
ADDI 8. ; PST to GMT
MOVE 1,400261 ; DAYLIT
MOVE 1,400000(1)
SKIPE 1
SOS ; daylight losing time
CAIG 23.
JRST HRWIN
SUBI 24.
AOS 2
CAIN 2,7
SETZ 2,
HRWIN: LSH 2,5
ADD 2,
JSR GETNUM
CAIG 59.
CAIE 1,↑J
JRST ERROR
JUMPL ERROR
IDIVI 5
LSH 2,4
ADD 2,
HRRM 2,REASON
OUTSTR [ASCIZ/Reason:
5 → Scheduled PM
6 → Scheduled hardware work
7 → Scheduled software work
8 → Emergency restart
9 → Power outage
10 → Software breakpoint
11 → Hardware failure
12 → Not scheduled up
Why down?/]
JSR GETNUM
CAIL 5
CAILE 14
JRST ERROR
CAIE 1,↑J
JRST ERROR
HRLM REASON
MTAPE WHYDWN ;tell IMP why down and when up
NOWHEN: MTAPE [13] ;take NCP down
JRST PROMPT
;UNWEDG
SUBTTL Unwedge a link
UNWEDG: OUTSTR [ASCIZ/nwedge connection index #/]
JSR GETOCT
CAIE 1,↑J
JRST ERROR
MOVEM UNWIDX
MTAPE UNWUNW
JRST ERROR
JRST PROMPT
;RSTOP ALPHST HSTCHR HSTTAB
SUBTTL Network reset
RSTOP: OUTSTR [ASCIZ/eset host /]
JSR GETOCT
JUMPE ALPHST
CAIN 1,↑J
TDNE [400600,,000400]
JRST ERROR
MOVEM RSTHST
MTAPE RSTRST
JRST PROMPT
ALPHST: SETZM HSTSTR
MOVE [HSTSTR,,HSTSTR+1]
BLT HSTSTR+19.
MOVEI (1)
ANDI 177
CAIL 140
ANDI 137
MOVE 1,[440700,,HSTSTR]
HSTCHR: IDPB 1
INCHWL
CAIN ↑M
INCHWL
ANDI 177
CAIL 140
ANDI 137
CAIE ↑J
JRST HSTCHR
IOPUSH
JRST 4,.-1
PUSHJ 17,MAPHST
IOPOP
JRST 4,.-1
MOVEI HSTSTR
PUSHJ 17,HSTNAM
CAI
JRST [PUSHJ 17,UNMHST ? JRST ERROR]
MOVEM RSTHST
PUSHJ 17,UNMHST
MTAPE RSTRST
JRST PROMPT
HSTTAB==1
.INSRT NETWRK[NET,MRC]
;NETSTA MSGLUP NXTMSG NAME NMSGS MSG
SUBTTL NCP statistics reporter
NETSTA: OUTSTR [ASCIZ/tatistics
/]
SKIPN @IMPDIE
OUTSTR [ASCIZ/NCP is up
/]
SKIPE @IMPDIE
OUTSTR [ASCIZ/NCP is down
/]
MOVE 3,FLNOPS
MOVSI 4,-NMSGS
MSGLUP: MOVE (3)
JUMPE NXTMSG
OUTSTR @NAME(4)
PUSHJ 17,DECOUT
OUTSTR @MSG(4)
NXTMSG: AOS 3
AOBJN 4,MSGLUP
JRST PROMPT
NAME: [ASCIZ/FLNOPS /]
[ASCIZ/TRACES /]
[ASCIZ/ERWOMI /]
[ASCIZ/NIMPDN /]
[ASCIZ/IIREST /]
[ASCIZ/GNILL /]
[ASCIZ/ERWMI /]
[ASCIZ/INCMTR /]
[ASCIZ/ILLMT /]
[ASCIZ/BDRFNM /]
[ASCIZ/NODDBS /]
[ASCIZ/UNKLNK /]
[ASCIZ/NRFNL /]
[ASCIZ/NILLOP /]
[ASCIZ/BSILL /]
[ASCIZ/BCMM /]
[ASCIZ/RERRM /]
[ASCIZ/NILLLD /]
[ASCIZ/N2RFCS /]
[ASCIZ/NHOST0 /]
[ASCIZ/SLNOPS /]
[ASCIZ/NHANGS /]
[ASCIZ/NRSETS /]
[ASCIZ/NMESIN /]
[ASCIZ/NMESOU /]
[ASCIZ/NNOLNK /]
[ASCIZ/NSCLSS /]
[ASCIZ/OPTMO /]
[ASCIZ/SLUNLK /]
[ASCIZ/RWNOSS /]
[ASCIZ/NIWCNO /]
[ASCIZ/NSSC /]
[ASCIZ/NALWNC /]
NMSGS==.-NAME
MSG: [ASCIZ/ IMP-HOST no-ops
/]
[ASCIZ/ trace messages
/]
[ASCIZ/ leader errors
/]
[ASCIZ/ IMP going down messages
/]
[ASCIZ/ interface reset messages
/]
[ASCIZ/ homosocketual RFC's
/]
[ASCIZ/ data errors
/]
[ASCIZ/ incomplete transmissions
/]
[ASCIZ/ illegal type messages
/]
[ASCIZ/ spurious RFNM's
/]
[ASCIZ/ missing DDB's
/]
[ASCIZ/ messages to non-ex link
/]
[ASCIZ/ spurious RFNMs with no links
/]
[ASCIZ/ new control messages
/]
[ASCIZ/ illegal byte sizes
/]
[ASCIZ/ short control messages
/]
[ASCIZ/ protocol errors
/]
[ASCIZ/ illegal leaders
/]
[ASCIZ/ duplicate RFCs
/]
[ASCIZ/ messages from host 0
/]
[ASCIZ/ Host-Host no-ops
/]
[ASCIZ/ input blocks due to no FS
/]
[ASCIZ/ resets
/]
[ASCIZ/ messages received
/]
[ASCIZ/ messages sent
/]
[ASCIZ/ all links in use
/]
[ASCIZ/ CLSs on non-ex socket
/]
[ASCIZ/ interface time outs
/]
[ASCIZ/ Host-host unknown links
/]
[ASCIZ/ messages with no socket
/]
[ASCIZ/ message without connection
/]
[ASCIZ/ messages on closed socket
/]
[ASCIZ/ allocates on non-ex link
/]
IFN .-MSG-NMSGS,.ERR lossage in message tables
;USLOGR RFCSER CHKLNK CONMSG NXTLNK
SUBTTL Logger
USLOGR: MOVSI (PRIVS)
SETPRV
TLC (PRIVS)
TLNE (PRIVS)
JRST ERROR
OUTSTR [ASCIZ/ogger
/]
IRPS SYM,,LOGGER FFLNK
MOVEI [.RSQZ 0,SYM ? 0]
.SYML
JRST 4,.-1
ADDI 400000
MOVEM SYM
TERMIN
IRPS SYM,,LNKTAB LNKDDB IMPLS IMPFS IMPSTB
MOVEI [.RSQZ 0,SYM ? 0]
.SYML
JRST 4,.-1
ADDI 377777
HRRM SYM
TERMIN
MOVSI 377776 ; map monitor in with write access
SETPR2
JRST 4,.-1
MOVE 1,400226 ; JOB
MOVE 1,400000(1)
MOVEM 1,@LOGGER ; seize the logger resource
MOVE 2,400211 ; PRJPRG
ADDI 2,400000(1)
MOVE 2,(2)
MOVEM 2,RUNPPN ; set running PPN of servers
MOVEI [DISMIS] ; set up interrupt
MOVEM JOBAPR
MOVSI (INTIMS) ; magic logger interrupt
INTENB
RFCSER: MOVE 7,@FFLNK ; set up pointer to links
CHKLNK: SKIPE @LNKDDB ; ignore links with a DDB
JRST NXTLNK
MOVE @IMPSTB ; get status of this link
TLNE (RFCR) ; somebody listening?
TLNE (RFCS\CLSR\CLSS\LGONCE) ; link already been munged?
JRST NXTLNK
MOVSI (LGONCE)
IORM @IMPSTB ; flag we've looked at the link
MOVE @IMPLS ; get socket for this link
CAIGE 400 ; public socket?
TRNN 1 ; and heterosocketual?
JRST NXTLNK
PUSH 17,@IMPFS ; save socket info on stack
PUSH 17,@IMPLS
PUSH 17,@LNKTAB
LSHC -6 ; separate 3 digits by three bits
LSH 3
LSHC 3
LSH 3
LSHC 3
ADDI '000 ; form sixbit socket number
HRRM SVRNAM
MOVEI SWPBLK
SWAP ; fire up the server
JUMPE [ OUTSTR [ASCIZ/Ign RFC/]
JRST CONMSG] ; couldn't fire up server!
OUTSTR [ASCIZ/RFC j=/] ; server job
PUSHJ 17,DECOUT
CONMSG: OUTSTR [ASCIZ/, hst=/] ; host number
LDB [103017,,]
PUSHJ 17,OCTOUT
OUTSTR [ASCIZ/, lnk=/] ; link number
POP 17,
ANDI 377
PUSHJ 17,OCTOUT
OUTSTR [ASCIZ/, lsk=/] ; local socket number
POP 17,
PUSHJ 17,OCTOUT
OUTSTR [ASCIZ/, fsk=/] ; foreign socket number
POP 17,
PUSHJ 17,OCTOUT
OUTSTR [ASCIZ/.
/]
NXTLNK: SOJG 7,CHKLNK ; try next link
IWAIT ; wait for next interrupt
JRST RFCSER
;DECOUT OCTOUT NUMOUT GETNUM GETNM1 GETOCT GETOC1
SUBTTL Subroutines
; Decimal/octal print routine
DECOUT: SKIPA 2,[10.] ; decimal print
OCTOUT: MOVEI 2,8. ; octal print
NUMOUT: IDIVI (2)
PUSH 17,1
SKIPE
PUSHJ 17,NUMOUT
POP 17,
ADDI "0
OUTCHR
POPJ 17,
GETNUM: 0
SETZ
GETNM1: INCHWL 1
CAIN 1,↑M
INCHWL 1
ANDI 1,177
CAIL 1,"0
CAILE 1,"9
JRST @GETNUM
IMULI 10.
ADDI -"0(1)
JRST GETNM1
GETOCT: 0
SETZ
GETOC1: INCHWL 1
CAIN 1,↑M
INCHWL 1
ANDI 1,177
CAIL 1,"0
CAILE 1,"7
JRST @GETOCT
LSH 3
ADDI -"0(1)
JRST GETOC1
END IMP